﻿//------------------------------------------------------------------------------
// 创建标识: Copyright (C) 2009 Socansoft.com 版权所有
// 创建描述: SocanCode代码生成器自动创建于 2009-5-11 13:14:23
//
// 功能描述: 
//
// 修改标识: 
// 修改描述: 
//------------------------------------------------------------------------------

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

public partial class Controls_TaoBaoTB_SHANGDIANListControl : System.Web.UI.UserControl
{
    public event RepeaterCommandEventHandler ItemCommand;
    public List<int> Selected
    {
        get
        {
            List<int> l = new List<int>();
            foreach (RepeaterItem item in rptTB_SHANGDIAN.Items)
            {
                CheckBox cb = item.FindControl("chkChoose") as CheckBox;
                if (cb != null && cb.Checked)
                {
                    HiddenField fld = item.FindControl("hfTB_SHANGDIAN") as HiddenField;
                    if (fld != null)
                    {
                        int id = Convert.ToInt32(fld.Value);
                        l.Add(id);
                    }
                }
            }
            return l;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
    }

    public void Bind(List<Model.TaoBao.TB_SHANGDIAN> l)
    {
        rptTB_SHANGDIAN.DataSource = l;
        rptTB_SHANGDIAN.DataBind();
    }

    protected void rptTB_SHANGDIAN_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (ItemCommand != null)
            ItemCommand(source, e);
    }
    protected string GetLYName(object o)
    {
        if (o is DBNull || o.ToString().Length==0)
            return null;
        string code = o.ToString();
        Model.ORDERFROM order = new BLL.ORDERFROM().GetModel(code);
        return order.OF_NAME;
    }
}
